﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PdfLibrary
{
    public class PdfBoolean : IPdfObject
    {
        public bool Value;

        public bool LoadFromReader(PdfReader reader, bool throwException)
        {
            if (!bool.TryParse(reader.ReadWord(), out this.Value))
                if (throwException) throw new PdfParsingException(reader, "PdfBoolean parsing error: value is not bool!");
                else return false;

            return true;
        }
    }
}